package com.hwadee.controller;

import com.hwadee.mapper.PermissionMapper;
import com.hwadee.pojo.Permission;
import com.hwadee.service.PermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/api/permission")
public class PermissionController {

    @Autowired
    private PermissionService permissionService;
    //获取所有权限数据的接口
    @GetMapping("/list")
    public List<Permission> getAllPermissions() {
        return permissionService.getAllPermissions();
    }
}

